<?php

namespace app\models\base;

use Yii;

/**
 * This is the model class for table "{{%answer}}".
 *
 * @property integer $answer_id
 * @property string $content
 * @property integer $question_id
 * @property integer $answer_user_id
 * @property integer $answer_time
 * @property integer $disabled
 * @property integer $last_modify
 * @property string $answer_img
 */
class Answer extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%answer}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['content', 'question_id', 'answer_user_id', 'answer_time'], 'required'],
            [['content'], 'string'],
            [['question_id', 'answer_user_id', 'answer_time', 'disabled', 'last_modify'], 'integer'],
            [['answer_img'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'answer_id' => '回答 ID',
            'content' => '回答内容',
            'question_id' => '问题 ID',
            'answer_user_id' => '回答人 ID',
            'answer_time' => '回答时间',
            'disabled' => 'Disabled',
            'last_modify' => '最后修改时间',
            'answer_img' => '图片',
        ];
    }
}
